﻿using KingsSharp.Common;
using KingsSharp.Common.Data;
using KingsSharp.Core;
using KingsSharp.Core.Data;
using CRM.Admin.Contracts.Contract.Logs;
using CRM.Admin.Contracts.Dto.Logs;
using CRM.Admin.Contracts.Model.Logs;
using System;
using System.Linq;

namespace CRM.Admin.Services.Service.Logs
{
    public class LoginLogService: ServiceBase,ILoginLogService
    {
        private IRepository<LoginLog, Guid> LoginLogRepository;
        public LoginLogService(IRepository<LoginLog, Guid> _LoginLogRepository)
            :base(_LoginLogRepository.UnitOfWork)
        {
            LoginLogRepository = _LoginLogRepository;
        }

        public IQueryable<LoginLog> ItemLoginlog
        {
            get
            {
                return LoginLogRepository.Entities;
            }
        }

        public OperationResult InsertLoginlog(params LoginLogDto[] dtos)
        {
            dtos.CheckNotNull("dtos");
            var result = LoginLogRepository.Insert(dtos);
            return result;
        }
    }
}
